#include <stdio.h>
#include "queue.h"

int queue_init(queue_t **q, int size, int capacity)
{
	return seqlist_init(q, capacity, size);
}

int queue_empty(const queue_t *q)
{
	return q->nmemb <= 0;
}

int queue_enqueue(queue_t *q, const void *data)
{
	return seqlist_insert_tail(q, data);
}

static int __always_cmp(const void *data, const void *key)
{
	return 0;
}

int queue_dequeue(queue_t *q, void *data)
{
	return seqlist_fetch(q, NULL, __always_cmp, data);
}

void queue_destroy(queue_t **q)
{
	seqlist_destroy(q);
}
